package config

type JustConfig struct {
	Reverseproxys []*ReverseproxyConfig `yaml:"reverseproxys"`
}

// ##反向代理配置
type ReverseproxyConfig struct {
	Protocol    string     `yaml:"protocol" mapstructure:"protocol"`
	ServerAddr  string     `yaml:"server_addr" mapstructure:"server_addr"`
	RealAddr    []string   `yaml:"real_addr" mapstructure:"real_addr"`
	BalanceMode int64      `yaml:"balance_mode" mapstructure:"balance_mode"`
	Poitision   int64      `yaml:"poitision" mapstructure:"poitision"`
	Transport   *Transport `yaml:"transport" mapstructure:"transport"`
	PathMap     []*PathMap `yaml:"path_map" mapstructure:"path_map"`
}

// 反向代理的路由转换
type PathMap struct {
	Source string `yaml:"source" mapstructure:"source"`
	Target string `yaml:"target" mapstructure:"target"`
}

// 反向代理连接池配置
type Transport struct {
	Timeout               int64 `yaml:"timeout" mapstructure:"timeout"`
	Keepalive             int64 `yaml:"keepalive" mapstructure:"keepalive"`
	MaxIdleconn           int64 `yaml:"max_idleconn" mapstructure:"max_idleconn"`
	IdleconnTimeout       int64 `yaml:"idleconn_timeout" mapstructure:"idleconn_timeout"`
	TLSHandshakeTimeout   int64 `yaml:"tls_handshake_timeout" mapstructure:"tls_handshake_timeout"`
	ExpectContinueTimeout int64 `yaml:"expect_continue_timeout" mapstructure:"expect_continue_timeout" `
}
